<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">{{ nickname }}</block>
		</cu-custom>
		<view>
			<view class="padding-lr padding-tb-xs">
				<button class="cu-btn block shadow bg-gradual-blue margin lg" @click="gourl('/pages/other/password')">修改密码</button>
				<button class="cu-btn block shadow bg-white margin text-red lg" @click="loginOut">退出登录</button>
			</view>
		</view>
	</view>
</template>

<script>
	 
	export default{
		data:function(){
			return {
				nickname: this.$store.getters.userInfo.nickname,
				ssuserid:this.$store.getters.userInfo._id
			}
		},
		methods:{
			getPage: function () {
				var that=this;
				uniCloud.callFunction({
					name:"user-center",
					data:{
						action:"get",
						id:this.ssuserid
					},
					success:function(e){
						var res=e.result;
						if(res.error){
							return false;
						}
						that.user=res.data.user
					}
				}) 
			},
			gourl:function(url){
				uni.navigateTo({
					url:url,
				})
			},
			loginOut:function(){
				this.$store.dispatch('logout')
			} 
		},
	}
</script>

<style scoped lang="scss">
	
</style>
